import store from '@/store'
export default function() {
	return new Promise(function(resolve, reject) {
		let {
			token,
			tokenExpired
		} = localStorage;
		if (token) {
			let now = +new Date();
			if (now >= tokenExpired) {
				// Toast('您的账号长时间未登录,请重新登陆');
				localStorage.clear()
				resolve()
			} else {
				store.dispatch('UESR/getuserInfo', token).then(res => {
					resolve()
				})
			}
		} else {
			resolve()
		}
	})
}
